package com.spring.test;

import java.util.Date;

import org.apache.commons.lang3.time.DateFormatUtils;

public class DateUtil {

	/**
	 * 输入日期模式并把date日期对象转换为日期字符串
	 * @param date
	 * @param pattern
	 * @return
	 */
	public static String getStringDate(Date date, String pattern) {
		try {
			String strdate = DateFormatUtils.format(date, pattern);
			return strdate;
		} catch (Exception pe) {
		}
		return null;
	}
	

}
